﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.WindowsServerSolutions.Common;

namespace Serviio.WHS
{
    public class LogFacade
    {
        public static LogFacade GetLogger(Type module)
        {
            return new LogFacade(module);
        }
        
        private Type module;
        private string moduleName;
        private LogFacade(Type module)
        {
            this.module = module;
            this.moduleName = module.ToString();
        }

        public void Error(object obj)
        {
            Support.TrError(0, moduleName + ": " + obj.ToString());
        }
        public void Error(string message, object obj)
        {
            Support.TrError(0, moduleName + ": " + message, obj.ToString());
        }

        public void Warn(object obj)
        {
            Error(obj);
        }
        public void Warn(string message, object obj)
        {
            Error(message, obj);
        }

        public void Info(object obj)
        {
            Support.TrStatus(moduleName + ": " + obj.ToString());
        }
        public void Info(string message, object obj)
        {
            Support.TrStatus(moduleName + ": " + message, obj.ToString());
        }

        public void Debug(object obj)
        {
            System.Diagnostics.Debug.WriteLine(moduleName + ": " + obj.ToString());
        }
        public void Debug(string message, object obj)
        {
            System.Diagnostics.Debug.WriteLine(moduleName + ": " + message + "\n" + obj.ToString());
        }
    }
}
